package com.rdc.example.service;

import com.rdc.example.bean.PageBean;
import com.rdc.example.bean.Result;
import com.rdc.example.bean.dto.UserDTO;
import org.apache.commons.fileupload.FileItem;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author Wookie
 * @description 用户service业务层接口
 */
public interface UserService {

    /**
     * 用户登录
     * @param userName 用户名
     * @param password 密码
     * @return 返回登录结果Result
     */
    Result login(String userName, String password) throws Exception;

    Result insertUser(UserDTO userDTO,List<FileItem> fileItems) throws Exception;

    Boolean checkUserName(String userName) throws Exception;


    Result updateUser(UserDTO userDTO) throws Exception;

    Result updateUser(UserDTO userDTO, List<FileItem> fileItems) throws Exception;

    Result updateUserToMusicer(Integer userId) throws Exception;

    Result updateUserToManager(Integer userId) throws Exception;

    Result updateUserWallet(Integer userId, BigDecimal changeValue) throws Exception;

    Result updateUserVipEndAt(Integer userId, Integer days) throws Exception;

    Result setCodeToEmail(String userName) throws Exception;

    Result updatePassword(String userName, String password) throws Exception;

    UserDTO getUserById(Integer id) throws Exception;

    UserDTO getUserByUserName(String name) throws Exception;

    PageBean<UserDTO> searchUsersByUsername(String keyword, Integer currentPage, Integer pageSize) throws Exception;
}
